<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Docker,">










<meta name="description" content="Nextcloud docker 安装教程注意: 本教程不是官方的nextcloud的docker教程,   本页内容来自github: https://github.com/chrootLogin/docker-nextcloud 我的安装命令12345# docker pull rootlogin/nextcloud &amp;amp;&amp;amp; docker pull mariadb:10# doc">
<meta name="keywords" content="Docker">
<meta property="og:type" content="article">
<meta property="og:title" content="Nextcloud docker 安装教程">
<meta property="og:url" content="https://blog.xiezc.xyz/2018/11/02/docker/docker安装nextcloud教程/index.html">
<meta property="og:site_name" content="xiezc的小站">
<meta property="og:description" content="Nextcloud docker 安装教程注意: 本教程不是官方的nextcloud的docker教程,   本页内容来自github: https://github.com/chrootLogin/docker-nextcloud 我的安装命令12345# docker pull rootlogin/nextcloud &amp;amp;&amp;amp; docker pull mariadb:10# doc">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-04-04T14:44:55.952Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Nextcloud docker 安装教程">
<meta name="twitter:description" content="Nextcloud docker 安装教程注意: 本教程不是官方的nextcloud的docker教程,   本页内容来自github: https://github.com/chrootLogin/docker-nextcloud 我的安装命令12345# docker pull rootlogin/nextcloud &amp;amp;&amp;amp; docker pull mariadb:10# doc">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://blog.xiezc.xyz/2018/11/02/docker/docker安装nextcloud教程/">





  <title>Nextcloud docker 安装教程 | xiezc的小站</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?8ae02d8cf311eabbae2621ff2d51a260";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">xiezc的小站</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">xiezc的小站</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://blog.xiezc.xyz/2018/11/02/docker/docker安装nextcloud教程/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="xiezc">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="xiezc的小站">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Nextcloud docker 安装教程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-11-02T15:08:39+08:00">
                2018-11-02
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index">
                    <span itemprop="name">java</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/2018/11/02/docker/docker安装nextcloud教程/" class="leancloud_visitors" data-flag-title="Nextcloud docker 安装教程">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Nextcloud-docker-安装教程"><a href="#Nextcloud-docker-安装教程" class="headerlink" title="Nextcloud docker 安装教程"></a>Nextcloud docker 安装教程</h1><p><strong>注意: </strong>本教程不是官方的nextcloud的docker教程,  </p>
<p>本页内容来自github: <a href="https://github.com/chrootLogin/docker-nextcloud" target="_blank" rel="noopener">https://github.com/chrootLogin/docker-nextcloud</a></p>
<h2 id="我的安装命令"><a href="#我的安装命令" class="headerlink" title="我的安装命令"></a>我的安装命令</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span> docker pull rootlogin/nextcloud &amp;&amp; docker pull mariadb:10</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span> docker run -d --name nextcloud_db -v /home/xiezc/mariadb:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=xzc123456 -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=xzc123456 mariadb:10</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span> docker run -d --name nextcloud --link nextcloud_db:nextcloud_db -p 7999:80 -v /home/xiezc/nextcloud/data:/data rootlogin/nextcloud</span><br></pre></td></tr></table></figure>
<p>Easy usable docker image for <a href="http://nextcloud.com/" target="_blank" rel="noopener">Nextcloud</a>, the community fork of OwnCloud.</p>
<h2 id="Features"><a href="#Features" class="headerlink" title="Features"></a>Features</h2><ul>
<li>Uses latest stable version of <strong>Alpine Linux</strong>, bundled with <strong>PHP 7</strong> and <strong>NGinx</strong>.</li>
<li>GPG check during building process.</li>
<li>APCu already configured.</li>
<li>LDAP support.</li>
<li>Cron runs all 15 mins (No need for web or AJAX cron).</li>
<li>Persistence for data, configuration and apps.</li>
<li>Nextcloud included apps that are persistent will be automatically updated during start.</li>
<li>Works with MySQL/MariaDB and PostgreSQL (server not included).</li>
<li>Supports uploads up to 10GB.</li>
<li>This image is also available via <a href="http://quay.io/rootlogin/nextcloud" target="_blank" rel="noopener">Quay.io</a>.</li>
</ul>
<h2 id="Container-environment"><a href="#Container-environment" class="headerlink" title="Container environment"></a>Container environment</h2><h3 id="Included-software"><a href="#Included-software" class="headerlink" title="Included software"></a>Included software</h3><ul>
<li>Alpine Linux</li>
<li><strong>PHP 7</strong></li>
<li>APCu</li>
<li>NGinx</li>
<li>cron</li>
<li>SupervisorD</li>
</ul>
<p>Everything is bundled in the newest stable version.</p>
<h3 id="Tags"><a href="#Tags" class="headerlink" title="Tags"></a>Tags</h3><ul>
<li><strong>latest</strong>: latest stable Nextcloud version (PHP 7)</li>
<li><strong>X.X.X</strong>: stable version tags of Nextcloud (e.g. v9.0.52) (Version &gt;= 12.0.0 use PHP 7)</li>
<li><strong>develop</strong>: latest development branch (may unstable)</li>
</ul>
<h3 id="Build-time-arguments"><a href="#Build-time-arguments" class="headerlink" title="Build-time arguments"></a>Build-time arguments</h3><ul>
<li><strong>NEXTCLOUD_GPG</strong>: Fingerprint of Nextcloud signing key</li>
<li><strong>NEXTCLOUD_VERSION</strong>: Nextcloud version to install</li>
<li><strong>UID</strong>: User ID of the nextcloud user (default 1501)</li>
<li><strong>GID</strong>: Group ID of the nextcloud user (default 1501)</li>
</ul>
<h3 id="Exposed-ports"><a href="#Exposed-ports" class="headerlink" title="Exposed ports"></a>Exposed ports</h3><ul>
<li><strong>80</strong>: NGinx webserver running Nextcloud.</li>
</ul>
<h3 id="Volumes"><a href="#Volumes" class="headerlink" title="Volumes"></a>Volumes</h3><ul>
<li><strong>/data</strong> : All data, including config and user downloaded apps (in subfolders).</li>
</ul>
<h2 id="Usage"><a href="#Usage" class="headerlink" title="Usage"></a>Usage</h2><h3 id="Standalone"><a href="#Standalone" class="headerlink" title="Standalone"></a>Standalone</h3><p>You can run Nextcloud without a separate database, but I don’t recommend it for production setups as it uses SQLite. Another solution is to use an external database provided elsewhere, you can enter the credentials in the installer.</p>
<ol>
<li>Pull the image: <code>docker pull rootlogin/nextcloud</code></li>
<li>Run it: <code>docker run -d --name nextcloud -p 80:80 -v my_local_data_folder:/data rootlogin/nextcloud</code> (Replace <em>my_local_data_folder</em> with the path where do you want to store the persistent data)</li>
<li>Open <a href="http://localhost/" target="_blank" rel="noopener">localhost</a> and profit!</li>
</ol>
<p>The first time you run the application, you can use the Nextcloud setup wizard to install everything. Afterwards it will run directly.</p>
<h3 id="With-a-database-container"><a href="#With-a-database-container" class="headerlink" title="With a database container"></a>With a database container</h3><p>For standard setups I recommend the use of MariaDB, because it is more reliable than SQLite. For example, you can use the offical docker image of MariaDB. For more information refer to the according docker image.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># docker pull rootlogin/nextcloud &amp;&amp; docker pull mariadb:10</span><br><span class="line"># docker run -d --name nextcloud_db -v my_db_persistence_folder:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=supersecretpassword -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=supersecretpassword mariadb:10</span><br><span class="line"># docker run -d --name nextcloud --link nextcloud_db:nextcloud_db -p 80:80 -v my_local_data_folder:/data rootlogin/nextcloud</span><br></pre></td></tr></table></figure>
<p><em>The auto-connection of the database to nextcloud is not implemented yet. This is why you need to do that manually.</em></p>
<h2 id="Configuration"><a href="#Configuration" class="headerlink" title="Configuration"></a>Configuration</h2><p>You can configure Nextcloud via the occ command:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># docker exec -ti nextcloud occ [...YOUR COMMANDS...]</span><br></pre></td></tr></table></figure>
<p>The command uses the same user as the webserver.</p>
<h2 id="Other"><a href="#Other" class="headerlink" title="Other"></a>Other</h2><h3 id="Migrate-from-OwnCloud"><a href="#Migrate-from-OwnCloud" class="headerlink" title="Migrate from OwnCloud"></a>Migrate from OwnCloud</h3><p>You can easily migrate an existing OwnCloud to this Nextcloud docker image.</p>
<p><strong>Before starting, always make a backup of your old OwnCloud instance. I told you so!</strong></p>
<ol>
<li>Enable the maintenance mode on your old OwnCloud instance, e.g. <code>sudo -u www-data ./occ maintenance:mode --on</code></li>
<li>Create a new folder e.g. /var/my_nextcloud_data</li>
<li>Create a new subfolder called “config” and copy the config.php from your existing instance in there.</li>
<li>Copy your existing “data” folder to <em>/var/my_nextcloud_data</em>/data</li>
<li>Start the docker container: <code>docker run -d --name nextcloud -p 80:80 -v /var/my_nextcloud_data:/data rootlogin/nextcloud</code></li>
<li>Wait until everything is running.</li>
<li>Start the Nextcloud migration command: <code>docker exec nextcloud occ upgrade</code></li>
<li>Disable the maintenance mode of Nextcloud: <code>docker exec nextcloud occ maintenance:mode --off</code></li>
<li><strong>Profit!</strong></li>
</ol>
<h3 id="Run-container-with-systemd"><a href="#Run-container-with-systemd" class="headerlink" title="Run container with systemd"></a>Run container with systemd</h3><p>I usually run my containers on behalf of systemd, with the following config:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">[Unit]</span><br><span class="line">Description=Docker - Nextcloud container</span><br><span class="line">Requires=docker.service</span><br><span class="line">After=docker.service</span><br><span class="line"></span><br><span class="line">[Service]</span><br><span class="line">Restart=always</span><br><span class="line">ExecStart=/usr/bin/docker run -p 127.0.0.1:8000:80 -v /data/nextcloud:/data --name nextcloud rootlogin/nextcloud</span><br><span class="line">ExecStop=/usr/bin/docker stop -t 2 nextcloud ; /usr/bin/docker rm -f nextcloud</span><br><span class="line"></span><br><span class="line">[Install]</span><br><span class="line">WantedBy=default.target</span><br></pre></td></tr></table></figure>
<h3 id="NGinx-frontend-proxy"><a href="#NGinx-frontend-proxy" class="headerlink" title="NGinx frontend proxy"></a>NGinx frontend proxy</h3><p>This container does not support SSL or similar and is therefore not made for running directly in the world wide web. You better use a frontend proxy like another NGinx.</p>
<p>Here are some sample configs (The config need to be adapted):</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br></pre></td><td class="code"><pre><span class="line">server &#123;</span><br><span class="line">	listen 80;</span><br><span class="line">	server_name cloud.example.net;</span><br><span class="line"></span><br><span class="line">	# ACME handling for Letsencrypt</span><br><span class="line">	location /.well-known/acme-challenge &#123;</span><br><span class="line">  	alias /var/www/letsencrypt/;</span><br><span class="line">  	default_type &quot;text/plain&quot;;</span><br><span class="line"> 		try_files $uri =404;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	location / &#123;</span><br><span class="line">  	return 301 https://$host$request_uri;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">server &#123;</span><br><span class="line">  listen 443 ssl spdy;</span><br><span class="line">  server_name cloud.example.net;</span><br><span class="line"></span><br><span class="line">	ssl_certificate /etc/letsencrypt.sh/certs/cloud.example.net/fullchain.pem;</span><br><span class="line">  ssl_certificate_key /etc/letsencrypt.sh/certs/cloud.example.net/privkey.pem;</span><br><span class="line">  ssl_trusted_certificate /etc/letsencrypt.sh/certs/cloud.example.net/chain.pem;</span><br><span class="line">	ssl_dhparam /etc/nginx/dhparam.pem;</span><br><span class="line">	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;</span><br><span class="line"></span><br><span class="line">	ssl_session_cache shared:SSL:10m;</span><br><span class="line">	ssl_session_timeout 30m;</span><br><span class="line"></span><br><span class="line">	ssl_prefer_server_ciphers on;</span><br><span class="line">	ssl_ciphers &quot;ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4&quot;;</span><br><span class="line"></span><br><span class="line">	ssl_stapling on;</span><br><span class="line">	ssl_stapling_verify on;</span><br><span class="line"></span><br><span class="line">	add_header Strict-Transport-Security &quot;max-age=31536000&quot;;</span><br><span class="line"></span><br><span class="line">	access_log  /var/log/nginx/docker-nextcloud_access.log;</span><br><span class="line">  error_log   /var/log/nginx/docker-nextcloud_error.log;</span><br><span class="line"></span><br><span class="line">	location / &#123;</span><br><span class="line">    proxy_buffers 16 4k;</span><br><span class="line">    proxy_buffer_size 2k;</span><br><span class="line"></span><br><span class="line">    proxy_read_timeout 300;</span><br><span class="line">    proxy_connect_timeout 300;</span><br><span class="line">    proxy_redirect     off;</span><br><span class="line"></span><br><span class="line">    proxy_set_header   Host              $http_host;</span><br><span class="line">    proxy_set_header   X-Real-IP         $remote_addr;</span><br><span class="line">    proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;</span><br><span class="line">    proxy_set_header   X-Frame-Options   SAMEORIGIN;</span><br><span class="line"></span><br><span class="line">    client_max_body_size 10G;</span><br><span class="line"></span><br><span class="line">    proxy_pass http://127.0.0.1:8000;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="Frequently-Asked-Questions"><a href="#Frequently-Asked-Questions" class="headerlink" title="Frequently Asked Questions"></a>Frequently Asked Questions</h2><p><strong>Why does the start take so long?</strong></p>
<p>When you run the container it will reset the permissions on the /data folder. This means if you have much data, it takes some time. This helps to avoid permission issues.</p>
<h2 id="Overwritten-config"><a href="#Overwritten-config" class="headerlink" title="Overwritten config"></a>Overwritten config</h2><p>Some parameters in the Nextcloud configuration will be overwritten by the file in <code>root/opt/nextcloud/config/docker.config.php</code></p>
<h2 id="Group-User-ID"><a href="#Group-User-ID" class="headerlink" title="Group/User ID"></a>Group/User ID</h2><p>You can change the numerical user id and group id via build arguments.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ git clone https://github.com/chrootLogin/docker-nextcloud.git &amp;&amp; cd docker-nextcloud</span><br><span class="line">$ docker build -t rootlogin/nextcloud --build-arg UID=1000 --build-arg GID=1000 .</span><br><span class="line">$ docker run -p 80:80 rootlogin/nextcloud</span><br></pre></td></tr></table></figure>
<h2 id="Contribution"><a href="#Contribution" class="headerlink" title="Contribution"></a>Contribution</h2><p>This stuff is released under GPL. I’m happy about every pull-request, that makes this tool better.</p>
<h2 id="Donate"><a href="#Donate" class="headerlink" title="Donate"></a>Donate</h2><p>If you want to donate for this project, you can send me some coins to the following address.</p>
<p><strong>Bitcoin</strong>: 1CCzVGMgoEbd5Zn84QnqjNFRj4PZtAoTrC</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Docker/" rel="tag"># Docker</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/11/02/nginx_tomcat_jetty/centos安装nginx教程/" rel="next" title="centos安装nginx教程">
                <i class="fa fa-chevron-left"></i> centos安装nginx教程
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/11/02/java日志框架/logback配置示例/" rel="prev" title="logback配置实例">
                logback配置实例 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">xiezc</p>
              <p class="site-description motion-element" itemprop="description">主要一些技术文章, 有些文章是转载的</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">72</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                
                  <span class="site-state-item-count">1</span>
                  <span class="site-state-item-name">分类</span>
                
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">标签</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Nextcloud-docker-安装教程"><span class="nav-number">1.</span> <span class="nav-text">Nextcloud docker 安装教程</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#我的安装命令"><span class="nav-number">1.1.</span> <span class="nav-text">我的安装命令</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Features"><span class="nav-number">1.2.</span> <span class="nav-text">Features</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Container-environment"><span class="nav-number">1.3.</span> <span class="nav-text">Container environment</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Included-software"><span class="nav-number">1.3.1.</span> <span class="nav-text">Included software</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Tags"><span class="nav-number">1.3.2.</span> <span class="nav-text">Tags</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Build-time-arguments"><span class="nav-number">1.3.3.</span> <span class="nav-text">Build-time arguments</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Exposed-ports"><span class="nav-number">1.3.4.</span> <span class="nav-text">Exposed ports</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Volumes"><span class="nav-number">1.3.5.</span> <span class="nav-text">Volumes</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Usage"><span class="nav-number">1.4.</span> <span class="nav-text">Usage</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Standalone"><span class="nav-number">1.4.1.</span> <span class="nav-text">Standalone</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#With-a-database-container"><span class="nav-number">1.4.2.</span> <span class="nav-text">With a database container</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Configuration"><span class="nav-number">1.5.</span> <span class="nav-text">Configuration</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Other"><span class="nav-number">1.6.</span> <span class="nav-text">Other</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Migrate-from-OwnCloud"><span class="nav-number">1.6.1.</span> <span class="nav-text">Migrate from OwnCloud</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Run-container-with-systemd"><span class="nav-number">1.6.2.</span> <span class="nav-text">Run container with systemd</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#NGinx-frontend-proxy"><span class="nav-number">1.6.3.</span> <span class="nav-text">NGinx frontend proxy</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Frequently-Asked-Questions"><span class="nav-number">1.7.</span> <span class="nav-text">Frequently Asked Questions</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Overwritten-config"><span class="nav-number">1.8.</span> <span class="nav-text">Overwritten config</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Group-User-ID"><span class="nav-number">1.9.</span> <span class="nav-text">Group/User ID</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Contribution"><span class="nav-number">1.10.</span> <span class="nav-text">Contribution</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Donate"><span class="nav-number">1.11.</span> <span class="nav-text">Donate</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xiezc</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("eRAHvO0xVYwckgdXIVpfugRG-gzGzoHsz", "57lKp708hde92YeG1xX9MQj1");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

</body>
</html>
